package com.ruoyi.fit.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fit.mapper.HealthBasicMapper;
import com.ruoyi.fit.domain.HealthBasic;
import com.ruoyi.fit.service.IHealthBasicService;
import com.ruoyi.common.core.text.Convert;

/**
 * 健康基础数据Service业务层处理
 * 
 * @author useragent-1
 * @date 2025-05-16
 */
@Service
public class HealthBasicServiceImpl implements IHealthBasicService 
{
    @Autowired
    private HealthBasicMapper healthBasicMapper;

    /**
     * 查询健康基础数据
     * 
     * @param id 健康基础数据主键
     * @return 健康基础数据
     */
    @Override
    public HealthBasic selectHealthBasicById(Long id)
    {
        return healthBasicMapper.selectHealthBasicById(id);
    }

    /**
     * 查询健康基础数据列表
     * 
     * @param healthBasic 健康基础数据
     * @return 健康基础数据
     */
    @Override
    public List<HealthBasic> selectHealthBasicList(HealthBasic healthBasic)
    {
        return healthBasicMapper.selectHealthBasicList(healthBasic);
    }

    /**
     * 新增健康基础数据
     * 
     * @param healthBasic 健康基础数据
     * @return 结果
     */
    @Override
    public int insertHealthBasic(HealthBasic healthBasic)
    {
        healthBasic.setCreateTime(DateUtils.getNowDate());
        return healthBasicMapper.insertHealthBasic(healthBasic);
    }

    /**
     * 修改健康基础数据
     * 
     * @param healthBasic 健康基础数据
     * @return 结果
     */
    @Override
    public int updateHealthBasic(HealthBasic healthBasic)
    {
        healthBasic.setUpdateTime(DateUtils.getNowDate());
        return healthBasicMapper.updateHealthBasic(healthBasic);
    }

    /**
     * 批量删除健康基础数据
     * 
     * @param ids 需要删除的健康基础数据主键
     * @return 结果
     */
    @Override
    public int deleteHealthBasicByIds(String ids)
    {
        return healthBasicMapper.deleteHealthBasicByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除健康基础数据信息
     * 
     * @param id 健康基础数据主键
     * @return 结果
     */
    @Override
    public int deleteHealthBasicById(Long id)
    {
        return healthBasicMapper.deleteHealthBasicById(id);
    }
}
